﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WISD.Common
{
    public interface INamedObject
    {
        long Id { get; set; }
        string Name { get; set; }
        string DisplayText { get; set; }
    }

    public class NamedObject
    {
        public long Id { get; set; }
        public string Name { get; set; }
        public string DisplayText { get; set; }

        public NamedObject()
        {
        }

        public NamedObject(INamedObject obj)
        {
            this.Id = obj.Id;
            this.Name = obj.Name;
            this.DisplayText = obj.DisplayText;
        }
    }

    public class NamedTreeObject : NamedObject
    {
        private List<NamedTreeObject> _children;

        public NamedTreeObject() { }
        public NamedTreeObject(INamedObject obj) : base(obj) { }

        public long ParentId { get; set; }
        public List<NamedTreeObject> Children
        {
            get
            {
                if (_children == null)
                {
                    _children = new List<NamedTreeObject>();
                }
                return _children;
            }
            //set
            //{
            //    _
            //}
        }
    }
}
